home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 13333 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  768 b 

  1. Path: castle.nando.net!news
  2. From: actuary@nando.net  (Bill McCarthy)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Help:what is wrong this code?
  5. Date: 6 Apr 1996 02:50:41 GMT
  6. Organization: Nando.net Public Access
  7. Message-ID: <4k4m61$a6s@castle.nando.net>
  8. References: <4k3p3q$n76@brahms.udel.edu>
  9. Reply-To: actuary@nando.net  (Bill McCarthy)
  10. NNTP-Posting-Host: grail306.nando.net
  11. X-Newsreader: IBM NewsReader/2 v1.2.5
  12.  
  13. In <4k3p3q$n76@brahms.udel.edu>,
  14. yuehong@brahms.udel.edu (Yue-hong Zheng) writes:
  15.  
  16. >Why it give me 0.0000?
  17. >
  18. >#include <stdio.h>
  19. >main () {
  20. >double a=9.008;
  21. >printf("%f\n",sqrt(a));
  22. >return 0;
  23. >}
  24.  
  25. You have failed to declare sqrt before using it.  Either include <math.h>,
  26. or declare <double sqrt( double );>
  27.  
  28. Bill McCarthy
  29. actuary@nando.net
  30. Wendell, NC  USA
  31.  
  32.